<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex bindAccount_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between flex-sub bindAccount_fd0_0'>
					<view class='flex align-center bindAccount_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  bindAccount_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex align-center'>
						<text class='bindAccount_fd0_0_c1_c0'>账号绑定</text>
					</view>
					<view class='flex align-center bindAccount_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#3090FF"></u-loading>
				<view>加载中</view>
			</view>
			<!---绑定支付宝-微信flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout bindAccount_flex_1" v-else>
				<template v-for='(item,key0) in dataList'>
					<view class='flex flex-wrap align-center bindAccount_fd1_0' @tap.stop="gobangdingFunc(item.method_code)" :key='key0'>
						<image class='bindAccount_fd1_0_c0' mode="aspectFit" :src='item.thumb'></image>
						<text class='bindAccount_fd1_0_c1'>{{item.method_name}}</text>
						<template v-if="item.method_code == 'wx'">
							<text class='bindAccount_fd1_0_c2' v-if="isbind_wx=='1'">已绑定</text>
							<text class='bindAccount_fd1_0_c2_1' v-if="isbind_wx!='1'">未绑定</text>
						</template>
						<template v-else>
							<text class='bindAccount_fd1_0_c2' v-if="isbind_ali=='1'">已绑定</text>
							<text class='bindAccount_fd1_0_c2_1' v-if="isbind_ali!='1'">未绑定</text>
						</template>
						
						<image class='bindAccount_fd1_0_c3' mode="aspectFit" :src='STATIC_URL+"315.png"'></image>
					</view>
				</template>

			</view>

			<!---绑定支付宝-微信flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"isShow": true,
				"dataList": [],
				"isbind_ali": 0,
				"isbind_wx": 0,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.searchAccountFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取绑定状态
			async searchAccountFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.post(global.apiUrls.post656f1c3562775, {
					
				});
				this.isShow = false;
				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data.list;
				this.isbind_wx = infodataList.data.isbind_wx;
				this.isbind_ali = infodataList.data.isbind_ali;
				// console.log(infodataList.data);
			},
			//跳转绑定
			gobangdingFunc(method_code) {
				if (method_code == 'wx') {
					if (this.isbind_wx == 0) {
						this.$urouter.navigateTo(`/pages/wd/bindWechat/bindWechat?type=${this.isbind_wx}`);
					}
					
				} else if (method_code == 'alipay') {
					if (this.isbind_ali == 0) {
						this.$urouter.navigateTo(`/pages/wd/bindAlipay/bindAlipay?type=${this.isbind_ali}`);
					}
				}
				// if (method_code == 'wx') {
				// 	this.$urouter.navigateTo(`/pages/wd/bindWechat/bindWechat?type=${this.isbind_wx}`);
				// } else if (method_code == 'alipay') {
				// 	this.$urouter.navigateTo(`/pages/wd/bindAlipay/bindAlipay?type=${this.isbind_ali}`);
				// }
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.bindAccount_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.bindAccount_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.bindAccount_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.bindAccount_fd0_0_c0 {
		width: 180rpx;
	}

	.bindAccount_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.bindAccount_flex_1 {
		background: #fff;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 24rpx;
		border-radius: 16rpx;
	}

	.bindAccount_fd1_0_c3 {
		width: 12rpx;
		height: 22rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.bindAccount_fd1_0_c2_1 {
		margin: 0rpx 0rpx 0rpx auto;
		color: var(--benbenFontColor0);
		font-size: 32rpx;
		font-weight: 500;
	}

	.bindAccount_fd1_0_c2 {
		margin: 0rpx 0rpx 0rpx auto;
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
	}

	.bindAccount_fd1_0_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.bindAccount_fd1_0_c0 {
		width: 52rpx;
		height: 52rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.bindAccount_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 36rpx 0rpx 36rpx 0rpx;
	}
</style>